/*
This function calculates the sum of product of two vectors located in the Epiphany
local memory.
  
*/
#include <stdio.h>
#include <stdlib.h>
#include "e-lib.h"

int main(void)
{
  
#include "epu_dot.h"
 
  //Clear Sum
  (*(c))=0x0;

  //Sum of product calculation
  for (int i=0; i<N/CORES; i++){
    (*(c)) += a[i] * b[i];
  }

  //Raising "done" flag
  (*(d)) = 0x00000001;

  //Put core in idle state
  __asm__ __volatile__("idle");
}

